﻿char = 'abcevaefegsgdghfdefavbdr'
char_count = dict()
for i in char:
    if i in char_count:
        char_count[i] += 1
    else:
        char_count[i] = 1
print(char_count)
# print(dict(sorted(char_count.items(), key=lambda x: x[1],reverse=True)))
new_list = sorted(char_count.items(), key=lambda x: x[1], reverse=True)
print('*' * 30)
for i, (k, v) in enumerate(new_list):
    if i == 3:
        break
    print(k, v, sep=':')

# 写的不错，想到了使用字典与枚举，并使用了print的分割
